<div id="content" class="tag">
    <h1>
        <span id="tag" class="tag">
            <a class="name" href="/tag/<?=$data->tag->tag?>"><?=$data->tag->tag?></a>
            <?if(MEMBER):?><a class="add" href="javascript:copyTag('<?=$data->tag->ID?>');">+</a><?endif;?>
        </span>
    </h1>
    <?if(MEMBER):?>
    <form id="form" class="shareForm" method="POST" action="/json/tag/share">
        <div class="formLineLight">
            <span class="textarea"><textarea id="post" name="post" tabindex="1"></textarea></span>
            <span class="clear"></span>
        </div>
        <div class="formLineDark">
            <span class="submit">
                <span id="loader" class="loader"><img src="http://<?=COOKIELESS?>/themes/<?=THEME?>/images/loader.gif" alt="loader" /></span>
                <input name="tagID" type="hidden" value="<?=$data->tag->ID?>" />
                <input id="submit" class="submit" type="submit" value="<?=_('Send')?>" tabindex="2" />
                <span class="clear"></span>
            </span>
            <span class="clear"></span>
        </div>
    </form>
    <?else:?>
    <h2><?=sprintf(_('Please %slogin%s or %sjoin%s to share something about %s'),
        '<a href="/'.LANG.'/account/login">','</a>',
        '<a href="/'.LANG.'/account/join">','</a>',
        $data->tag->tag);?></h2>
    <?endif;?>
    <div class="clear"></div>
    <div id="shares">
        <?
        if($data->tag->shares) foreach ($data->tag->shares as $i)
        include 'apps/'.APP.'/template/_share_item.html';
        ?>
    </div>
    <div class="clear"></div>
</div>
<div id="aside">
    <h2><span><?=_('Created by')?></span></h2>
    <div id="creator">
        <?
        $p = $data->tag->creator;
        include 'apps/profile/template/mini.html';
        ?>
        <a class="creatorName" href="/profile/<?=$p->ID?>" title="<?=$p->fullname?>"><?=$p->fullname?></a>
        <span><?=common::timediff($data->tag->date);?></span>
        <div class="clear"></div>
    </div><br/>
    <h2><span><?=_('Added Persons')?></span></h2>
    <div id="users">
        <?
        foreach($data->tag->users as $p)
        include 'apps/profile/template/mini.html';
        ?>
    </div>
</div>
<?if(MEMBER):?>
<script type="text/javascript">
function  getMore(r){
    tool.post({
        'url':'/json<?=PREFIX.'/'.APP.'/'.CMD?>',
        'data':'CID=<?=PARAMS?>&earlier=1',
        onComplete:function(r){
            $('#earlier').html(tool.jsonDecode(r.message));
        }
    });
}
function _complete(r){
    $('<div>').html(tool.jsonDecode(r)).hide().prependTo('#shares').slideDown();
    $('#post').val('').focus();
    $('#submit').removeAttr('disabled');
    $('#loader').css('display','none');
}
tool.form(false,false,true);
</script>
<?endif;?>